<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<script src="js/jquery-1.11.1.min.js"></script>
<script>
    document.writeln("<script type=\"text/javascript\" src=\"js/common.js?" + Math.random() + "\"></scr" + "ipt>");
</script>

<script type="text/javascript">
    $(function () {
        var jumpUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?';
        var redirectUrl = Q.getDecoded("url") !== "null" ? Q.getDecoded("url") : shareUrl + "index_fxs.html?ADTAG=wx.readerday.com";
        var params = {
            appid: appId,
            redirect_uri: redirectUrl,
            response_type: 'code',
            scope: 'snsapi_userinfo',
            state: 'xyz',
        };
        jumpUrl += $.param(params) + '#wechat_redirect';
        location.href = jumpUrl;
    });

    var Q = Query = {
        getFromURL: function (url, parameter) {
            var index = url.indexOf("?");
            if (index != -1) {
                var parameterString = url.substr(index + 1);
                var reg = new RegExp("(^|&)" + parameter + "=([^&]*)(&|$)", "i");
                var r = parameterString.match(reg);
                if (r != null) {
                    return r[2];
                }
            }
            return null;
        },
        get: function (parameter) {
            if (typeof (parameter) == "undefined" || parameter == "") {
                return null;
            }
            var url = window.location.href;
            var index = url.indexOf("?");
            if (index != -1) {
                var parameterString = url.substr(index + 1);
                var reg = new RegExp("(^|&)" + parameter + "=([^&]*)(&|$)", "i");
                var r = parameterString.match(reg);
                if (r != null) {
                    return r[2];
                }
            }
            return null;
        },
        getInt: function (parameter, defaultValue) {
            var value = parseInt(this.get(parameter));
            return isNaN(value) ? (typeof(defaultValue) == "undefined" ? 0 : defaultValue) : value;
        },
        getDecoded: function (parameter) {
            return this.decode(this.get(parameter));
        },
        decode: function (srcStr) {
            if (typeof(srcStr) == "undefined") {
                return null;
            }
            return decodeURIComponent(srcStr);
        },
        encode: function (srcStr) {
            if (typeof(srcStr) == "undefined") {
                return null;
            }
            return encodeURIComponent(srcStr);
        },
        getSymbol: function (url) {
            return url.indexOf("?") == -1 ? "?" : "&";
        },
        joinURL: function (url, queryString) {
            return url + this.getSymbol(url) + queryString;
        },
        createQueryString: function (obj) {
            var a = [];
            for (var p in obj) {
                if (typeof(obj[p]) == "function" || obj[p] == null || typeof(obj[p]) == "undefined") continue;
                a.push(p + "=" + obj[p]);
            }
            return a.join("&");
        }
    };
</script>
</body>
</html>